package bayes.nodeTypes;

public abstract class Variable {

	protected String 			_name;
	private int 			_domainSize;
	private String _id;



	public Variable(String name, int domainSize){
		_name 		= name;
		_domainSize = domainSize;
	}

	public String get_name() {
		return _name;
	}

	public int get_domainSize() {
		return this._domainSize;
	}

	public String toString(){
		return "Variable: "+ this._name;
	}

	public String getName() {
		return _name;
	}

	public abstract String getDomainValName(int index);

	public int get_id() {
		int id = 0 ;
		char num1 = _name.charAt(_name.length()-1);
		char num2 = _name.charAt(_name.length()-2);
		if (num2 >= '0' && num2 <= '9'){
			id = 10 * (new Integer(num2+""));
		}
		id+= num1;
		return id;
	}

}
